home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / S-Sh / ScrollBar.cpt / ScrollBar Stack / card_6997.txt < prev    next >
Text File  |  1990-04-17  |  5KB  |  224 lines

  1. -- card: 6997 from stack: in
  2. -- bmap block id: 7672
  3. -- flags: 0000
  4. -- background id: 6693
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on openCard
  8.   send initButton to cd btn "Pitch"
  9.   send initButton to cd btn "Tempo"
  10. end openCard
  11.  
  12.  
  13.  
  14. -- part 2 (button)
  15. -- low flags: 00
  16. -- high flags: 0000
  17. -- rect: left=378 top=119 right=266 bottom=394
  18. -- title width / last selected line: 0
  19. -- icon id / first selected line: 0 / 0
  20. -- text alignment: 1
  21. -- font id: 0
  22. -- text size: 12
  23. -- style flags: 0
  24. -- line height: 16
  25. -- part name: Pitch
  26. ----- HyperTalk script -----
  27. on doControl
  28.   global Pitch
  29.   put ScrollBar(false, false, true, 0, 7, Pitch, 1) into Pitch
  30.   put Pitch into cd fld "Pitch"
  31. end doControl
  32.  
  33. on initButton
  34.   global Pitch
  35.   put 4 into Pitch
  36.   put Pitch into cd fld "Pitch"
  37. end initButton
  38.  
  39. on trackScroll
  40.   global ScrollValue
  41.   put ScrollValue into cd fld "Pitch"
  42. end trackScroll
  43.  
  44.  
  45.  
  46. -- part 3 (button)
  47. -- low flags: 00
  48. -- high flags: 0000
  49. -- rect: left=378 top=174 right=202 bottom=394
  50. -- title width / last selected line: 0
  51. -- icon id / first selected line: 0 / 0
  52. -- text alignment: 1
  53. -- font id: 0
  54. -- text size: 12
  55. -- style flags: 0
  56. -- line height: 16
  57. -- part name: 
  58. ----- HyperTalk script -----
  59. on mouseUp
  60.   send doControl to cd btn "Pitch"
  61. end mouseUp
  62.  
  63.  
  64.  
  65. -- part 4 (button)
  66. -- low flags: 00
  67. -- high flags: 0000
  68. -- rect: left=474 top=119 right=266 bottom=490
  69. -- title width / last selected line: 0
  70. -- icon id / first selected line: 0 / 0
  71. -- text alignment: 1
  72. -- font id: 0
  73. -- text size: 12
  74. -- style flags: 0
  75. -- line height: 16
  76. -- part name: Tempo
  77. ----- HyperTalk script -----
  78. on doControl
  79.   global Tempo
  80.   put ScrollBar(false, false, true, 1, 20, trunc(Tempo/30), 1) * 30 into Tempo
  81.   put Tempo into cd fld "Tempo"
  82. end doControl
  83.  
  84. on initButton
  85.   global Tempo
  86.   put 210 into Tempo
  87.   put Tempo into cd fld "Tempo"
  88. end initButton
  89.  
  90. on trackScroll
  91.   global ScrollValue
  92.   put ScrollValue * 30 into cd fld "Tempo"
  93. end trackScroll
  94.  
  95.  
  96.  
  97. -- part 5 (button)
  98. -- low flags: 00
  99. -- high flags: 0000
  100. -- rect: left=474 top=174 right=202 bottom=490
  101. -- title width / last selected line: 0
  102. -- icon id / first selected line: 0 / 0
  103. -- text alignment: 1
  104. -- font id: 0
  105. -- text size: 12
  106. -- style flags: 0
  107. -- line height: 16
  108. -- part name: 
  109. ----- HyperTalk script -----
  110. on mouseUp
  111.   send doControl to cd btn "Tempo"
  112. end mouseUp
  113.  
  114.  
  115.  
  116. -- part 6 (button)
  117. -- low flags: 00
  118. -- high flags: 8001
  119. -- rect: left=371 top=219 right=266 bottom=431
  120. -- title width / last selected line: 0
  121. -- icon id / first selected line: 12694 / 12694
  122. -- text alignment: 1
  123. -- font id: 0
  124. -- text size: 12
  125. -- style flags: 0
  126. -- line height: 16
  127. -- part name: Sample Tune
  128. ----- HyperTalk script -----
  129. on mouseUp
  130.   global Tempo, Pitch
  131.   playTune
  132.   set the name of me to "Stop Sample"
  133.   set the icon of me to "Sp 0"
  134.   repeat forever
  135.     if the sound is "done" or the mouse is "down" then exit repeat
  136.   end repeat
  137.   play stop
  138.   set the name of me to "Sample Tune"
  139.   set the icon of me to "Music Note"
  140. end mouseUp
  141.  
  142.  
  143.  
  144. -- part 7 (field)
  145. -- low flags: 01
  146. -- high flags: 0001
  147. -- rect: left=350 top=178 right=199 bottom=377
  148. -- title width / last selected line: 0
  149. -- icon id / first selected line: 0 / 0
  150. -- text alignment: 65535
  151. -- font id: 0
  152. -- text size: 12
  153. -- style flags: 0
  154. -- line height: 16
  155. -- part name: Pitch
  156.  
  157.  
  158. -- part 8 (field)
  159. -- low flags: 01
  160. -- high flags: 0001
  161. -- rect: left=443 top=178 right=200 bottom=473
  162. -- title width / last selected line: 0
  163. -- icon id / first selected line: 0 / 0
  164. -- text alignment: 65535
  165. -- font id: 0
  166. -- text size: 12
  167. -- style flags: 0
  168. -- line height: 16
  169. -- part name: Tempo
  170.  
  171.  
  172. -- part 9 (field)
  173. -- low flags: 81
  174. -- high flags: 0007
  175. -- rect: left=15 top=15 right=273 bottom=497
  176. -- title width / last selected line: 0
  177. -- icon id / first selected line: 0 / 0
  178. -- text alignment: 0
  179. -- font id: 4
  180. -- text size: 9
  181. -- style flags: 0
  182. -- line height: 12
  183. -- part name: Script
  184.  
  185.  
  186. -- part contents for background part 3
  187. ----- text -----
  188. The two buttons both popup a scroll bar when clicked which can then be used to alter the value of the pitch and tempo of the sample tune. The buttons do not call ScrollBar() directly but send a doControl message to a larger button which is the desired size of the scroll bar. To enable scroll bar popup doPaint is set false; and to track the values doControl is set true.
  189.  
  190. -- part contents for card part 7
  191. ----- text -----
  192. 4
  193.  
  194. -- part contents for card part 8
  195. ----- text -----
  196. 210
  197.  
  198. -- part contents for card part 9
  199. ----- text -----
  200. Script of adjust pitch button:
  201.  
  202. on mouseUp
  203.   send doControl to cd btn "Pitch"
  204. end mouseUp
  205.  
  206. Script of button Pitch:
  207.  
  208. on doControl
  209.   global Pitch
  210.   put ScrollBar(false, false, true, 0, 7, Pitch, 1) into Pitch
  211.   put Pitch into cd fld "Pitch"
  212. end doControl
  213.  
  214. on initButton
  215.   global Pitch
  216.   put 4 into Pitch
  217.   put Pitch into cd fld "Pitch"
  218. end initButton
  219.  
  220. on trackScroll
  221.   global ScrollValue
  222.   put ScrollValue into cd fld "Pitch"
  223. end trackScroll
  224.